@startuml !include https://raw.githubusercontent.com/adrianvlupu/C4-PlantUML/latest/C4_Dynamic.puml title Dynamic between microservices and Kafka as backbone of events on Ordering action LAYOUT_WITH_LEGEND() Person(customer, Customer, Customer of our online store) System_Ext(paymentBroker, "Third party Payment Broker", "Responsible for processing digital transfers in several forms like credit, debit, etc") System_Ext(shipmentCompany, "Third party Shipment Company", "Responsible for delivering goods from our store to our customers") Container(aosKafkaCluster, "Meesage Broker", Apache Kafka, "Kafka cluster assuming the role of a backbone of events allowing async communication between microservices") Container(aosWebApp, "Web App", ReactJS, "Frontend responsible for the UI of the online store") Container(aosApiGateway, "API Gateway", "?", "API Gateway responsible for exposing microservices' Rest API's for the webapp") Container(aosStockMicroservice, "Stock Microservice", "Java/Spring Boot", "Microservice responsible for handling the Store's Stock of products") Container(aosPaymentsMicroservice, "Payments Microservice", "Java/Spring Boot", "Microservice responsible for handling order payments") Container(aosOrdersMicroservice, "Orders Microservice", "Java/Spring Boot", "Microservice responsible for handling users orders") Container(aosNotificationsMicroservice, "Notifications Microservice", "Java/Spring Boot", "Microservice responsible for handling user notifications like email, sms...") Container(aosShipmentMicroservice, "Shipments Microservice", "Java/Spring Boot", "Microservice responsible for handling shipment") RelIndex_R(1, aosWebApp, aosApiGateway, "POST new order") RelIndex(2, aosApiGateway, aosOrdersMicroservice, "proxy POST new order") RelIndex(3, aosOrdersMicroservice, aosKafkaCluster, "are items available") RelIndex(4, aosKafkaCluster, aosStockMicroservice, "are items available") RelIndex(5, aosStockMicroservice, aosKafkaCluster, "items are available") RelIndex(6, aosKafkaCluster, aosOrdersMicroservice, "items are available") RelIndex(7, aosOrdersMicroservice, aosKafkaCluster, "process payment") RelIndex(8, aosKafkaCluster, aosPaymentsMicroservice, "process payment") RelIndex(9, aosPaymentsMicroservice, paymentBroker, "process payment") RelIndex(10, aosPaymentsMicroservice, aosKafkaCluster, "payment succeeded") RelIndex(11, aosKafkaCluster, aosOrdersMicroservice, "payment succeeded") RelIndex(12, aosOrdersMicroservice, aosKafkaCluster, "order approved") RelIndex(13, aosKafkaCluster, aosNotificationsMicroservice, "order approved") RelIndex(13, aosKafkaCluster, aosStockMicroservice, "order approved") RelIndex_R(13, aosKafkaCluster, aosShipmentMicroservice, "order approved") RelIndex(14, aosNotificationsMicroservice, customer, "order was approved") RelIndex_R(14, aosShipmentMicroservice, shipmentCompany, "ship order to customer") @enduml